<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        nav{
            position: relative;
            width: 200px;
            margin: 0;
            padding: 0;
        }
        ul{
            margin: 0;
            padding: 0;
            display: none;
        }
        li{
            overflow: hidden;
            height: 35px;
            background-color: rgba(0, 0, 0,0.5);
            line-height: 35px;  
            text-align: center;          
        }
        a{
            display: block;
            text-decoration: none;
            color: #fff;
            font-size:small;
            width: 100%;
            height: 100%;
        }
        li:nth-of-type(2n){
            background-color: rgba(0, 0, 0,0.6);
        }
        li:hover{
            background-color: #0099e5;
        }
        nav>span{
            display: block;
            height: 35px;
            line-height: 35px;
            background-color: #445055;
            text-align: center;
        }
        nav:hover>ul{
            display: block;
            position:absolute; 
            width: 200px;           
        }
    </style>
</head>

<body>
    <nav>
        <span>请选择课程:</span>
        <ul>
            <li><a href="https://www.baidu.com">JavaEE教程</a></li>
            <li><a href="#">Android教程</a></li>
            <li><a href="#">PHP教程</a></li>
            <li><a href="#">UI设计教程</a></li>
            <li><a href="#">iOS教程</a></li>
            <li><a href="#">Web前端教程</a></li>
            <li><a href="#">C/C++教程</a></li>
        </ul>
    </nav>
    <div>abc</div>
</body>

</html>